﻿using Service.Repository;
using SqlSugar;

namespace Service.Auth.Domain.AggregatesModel
{

    /// <summary>
    /// 接口模块
    /// </summary>
    [SugarTable("tb_module")]
    public class Module : Entity, IAggregateRoot
    {
        public Module()
        {
        }

        public Module(long id, string name, string controller, string httpMethod, string linkUrl, string description)
        {
            Id = id;
            Name = name;
            Controller = controller;
            HttpMethod = httpMethod;
            LinkUrl = linkUrl;
            Description = description;
        }

        /// <summary>
        ///  
        ///</summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
        public long Id { get; private set; }


        /// <summary>
        /// 名称 
        ///</summary>
        [SugarColumn(ColumnName = "name")]
        public string Name { get; private set; }

        /// <summary>
        /// 控制器
        /// </summary>
        [SugarColumn(ColumnName = "controller")]
        public string Controller { get; private set; }

        /// <summary>
        /// 支持的请求方式
        /// </summary>
        [SugarColumn(ColumnName = "http_method")]
        public string HttpMethod { get; private set; }

        /// <summary>
        /// 路由地址 
        ///</summary>
        [SugarColumn(ColumnName = "link_url")]
        public string LinkUrl { get; private set; }


        /// <summary>
        /// 描述 
        ///</summary>
        [SugarColumn(ColumnName = "description")]
        public string Description { get; private set; }
    }
}
